import { defineStore } from 'pinia'
// 登录存储
export const orderStore = defineStore({
  id: 'order',
  state: () => ({
    orderData: {}
  }),
  actions: {
    setOrderAppointmentDoctor (data) {
      this.orderData.appointmentDoctorId = data.doctorId
      this.orderData.doctorName = data.doctorName
    },
    setOrderConsultProjectId (data) {
      this.orderData.consultProjectId = data.id
      this.orderData.consultProject = data.name
    },
    setOrderPatientId (data) {
      this.orderData.patientId = data.id
      this.orderData.name = data.name
    },
    setOrderAppointmentTime (data) {
      this.orderData.appointmentTime = data
    },
    setHeight (data) {
      this.orderData.height = data
    },
    setWeight (data) {
      this.orderData.weight = data
    },
    setIllnessRemark (data) {
      this.orderData.illnessRemark = data
    },
    setOrderPics (data) {
      this.orderData.orderPics = data
    },
    setProjectId (data) {
      this.orderData.projectId = data.projectId
      this.orderData.projectName = data.projectName
    }
  },
  persist: {
    // 保存的位置
    storage: sessionStorage // localstorage
  }
})
